Fine Print

  • I am not an expert in any of the software that is covered in this document although I frequently use them.
  • If you mess up your files while using R or RStudio command prompt, git, and etc. or crash/burn/blow up your computer, please be aware that I do not accept any responsibility.
  • Please use the information contained at your own risk!!!

Important Notes

  • Please read this file carefully since it contains a lot of information about software and their installation.
  • The entire R mini BootCamp workshop is version controlled by Git.
  • All the files of this workshop are hosted on Bitbucket in a remote public git repository which can be found here.
    • To download the entire remote git public repository, please click here.
    • Please feel free to use and share any of the content without the permission of the repository owner.
  • This document is prepared with RStudio using R and R Markdown.
    • Please see here for the options of building a HTML document with R Markdown as this one.
  • All comments, suggestions, and other correspondences should be sent to Omer Kara.

1 Reproducing the Workshop

  • If you wish to run all the codes and reproduce the same results on your computer, please follow all of the instructions in the following order.
  • Before starting, if you are a PC user, make sure that Java is installed in your computer.
    • A system without Java or with a corrupted Java might cause errors while loading the XLConnect, XLConnectJars, and rJava packages.
    • Most of the PC users encounter Java error while loading the above packages, so my recommendation is to at least update your Java installation. You might find this link useful. Then go to Java to download the Java version that matches your needs.
    • If you skip this step and your Java installation is corrupted, most probably you will get a lot of errors when you start RStudio via R mini BootCamp.Proj file. If this is the case please redo all steps again.
  • Download and install R. Please see the instruction below.
  • Download and install RStudio. Please see the instruction below.
  • To download the entire remote git public repository, please click here.
    • Please click Download repisotory link to start the download.
    • You can download the file to any path in your local drive.
    • It might take a while to download so please be patient.
  • Rename the downloaded folder as R mini BootCamp.
  • Open the renamed R mini BootCamp folder.
  • Start your RStudio interactive session by double-clicking the R mini BootCamp.Proj file.
    • Starting RStudio via R mini BootCamp.Proj file ensures that all of the important paths, user-defined functions and the necessary packages are loaded correctly.
    • It might take a while to start RStudio for the first time especially if you are a Windows user or have R version 3.4.3., so please be patient.
    • If you are a Windows user, you might receive an error message starting with ‘Error in file(con, “w”) : cannot open the connection’. To fix this error, make .lastaccessed file in the .checkpoint/YYYY-MM-DD folder unhidden, where YYYY-MM-DD indicates year-month-date. Then restart your RStudio session.
  • Do not change any of the files in the R/Settings folder unless you know what you are doing.
    • Note that the files in the R/Settings folder manage the necessary packages for HTML documents and slides as well as the entire workshop.

2 For Mac Users

R and RStudio

  • R is the programming software we will use in this BootCamp. It is free and open-source. The necessary installation files can be found here. Please click the link “Download R for (Mac) OS X” and use the appropriate installation package matching your operation system on the files section.
  • RStudio is the integrated development environment (IDE) for R. The free and open-source version of RStudio can be downloaded from here. Note that you should download the RStudio Desktop version not the RStudio Server. At the bottom of that page you will see the installation files. Please use the appropriate link matching your operation system.
  • XQuartz installation is usually required to run some functions in R. Therefore, it is better to install it at the first place.
  • Please see this web page for a wonderful collection of RStudio cheat sheets.
  • R packages are collections of R functions, data, and compiled code in a well-defined format. Packages are the fundamental units of reproducible R code. One of the great things about R is that thousands of packages have been written to solve specific problems in various disciplines. Please see here for all available packages. For packages categorized by areas can be found here. In this page you can search packages by name and find several example codes, details and more. Finally, for recommended packages please see here and here.
  • For online learning tools such as tutorials, articles, and examples to help you learn R and its extensions, please see here and here.
  • Finally, to get some help about R coding please see Stack Overflow, Rseek, and google. R Views, R-bloggers, and RPubs are the best places for finding example codes, small tutorials, exploring what others are doing, and even publishing your R code.

Markdown

  • Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML). For more information about Markdown please see its wiki page.
  • Mou is the markdown editor I use. It is cleans, simple and easy to use. The best parts I like most are it is very fast and it has two-sided view (you can see the preview while writing your markdown).
  • Marked is the other markdown editor I use. I have used it rarely so far since it has a lot of options and tweaks that I need to investigate but unfortunately i don’t have time for that. If you are really into Markdown, I recommend using it.
  • Typora is the markdown editor that I found after a quick search. It seems to be free, have two-sided view, and a lot of other option. It is also available in PC.

R Markdown

  • R Markdown allows you to create documents (PDF, beamer slides, markdown, and HTML) that serve as a neat record of your text and coding with its output (graphs, tables, etc.). R Markdown is a wonderful tool for reproducible research. See here for the details and tutorial of R Markdown. Also, interested users should see here for the range of outputs and formats you can create using R Markdown.
  • To compile R Markdown files, Knitr is necessary which is an engine for dynamic report generation with R. For the details of Knitr see here.
  • R Markdown and Knitr come pre-installed with RStudio so there is need for further action.
  • If you are planing to use LaTeX to generate reports in PDF via R Markdown, it is better to install MacTeX distribution.

Shiny

  • Shiny is an R package that makes it easy to build interactive web apps straight from R. We are not going to cover Shiny; however, it is better to know it at least to understand the capabilities of R.
  • See here for a tutorial of Shiny. Some of the very good examples can be found in here and here.

Git

  • Git is a version control system for tracking changes in computer files. For more information about Git please see its wiki page.
  • The installation files for different operation systems can be found here. Mac users should see this link for installation files and much more.
  • Git is mainly used in terminal by Mac users; however, for some users it might be cumbersome (for me as well). Therefore, I suggest you to use a Graphical User Interface (GUI) for Git. All the GUIs can be found here. So far, I have tried SourceTree and GitHub Desktop. I prefer SourceTree since it is has better visualization, simple for beginners and can handle complicated git command very easily for experts. GitHub Desktop might be your choice if you need the simplest GUI.
  • See here for more information about Git. See here and even here for a tutorial of git.
  • To save your git repository remotely see Bitbucket or GitHub.
  • Finally for unlimited private remote repositories see here.

3 For PC Users

R and RStudio

  • R is the programming software we will use in this BootCamp. It is free and open-source. The necessary installation files can be found here. On this page, please click the link “Download R for Windows” and then click “install R for the first time”. Then, the link for the most recent version of R can be found at the top of the page.
  • RStudio is the integrated development environment (IDE) for R. The free and open-source version of RStudio can be downloaded from here. Note that you should download the RStudio Desktop version not the RStudio Server. At the bottom of that page you will see the installation files. Please use the appropriate link matching your operation system.
  • Please see this web page for a wonderful collection of RStudio cheat sheets.
  • R packages are collections of R functions, data, and compiled code in a well-defined format. Packages are the fundamental units of reproducible R code. One of the great things about R is that thousands of packages have been written to solve specific problems in various disciplines. Please see here for all available packages. For packages categorized by areas can be found here. In this page you can search packages by name and find several example codes, details and more. Finally, for recommended packages please see here and here.
  • For online learning tools such as tutorials, articles, and examples to help you learn R and its extensions, please see here and here.
  • Finally, to get some help about R coding please see Stack Overflow, Rseek, and google. R Views, R-bloggers, and RPubs are the best places for finding example codes, small tutorials, exploring what others are doing, and even publishing your R code.

Markdown

  • Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML). For more information about Markdown please see its wiki page.
  • Typora is the markdown editor that I found after a quick search. It seems to be free, have two-sided view, and a lot of other option. It is also available in Mac. For PC users, please use the appropriate version matching your operation system, 32 bit or 64 bit.
  • MarkdownPad is the other markdown editor I encountered while searching on Google.

R Markdown

  • R Markdown allows you to create documents (PDF, beamer slides, markdown, and HTML) that serve as a neat record of your text and coding with its output (graphs, tables, etc.). R Markdown is a wonderful tool for reproducible research. See here for the details and tutorial of R Markdown. Also, interested users should see here for the range of outputs and formats you can create using R Markdown.
  • To compile R Markdown files, Knitr is necessary which is an engine for dynamic report generation with R. For the details of Knitr see here.
  • R Markdown and Knitr come pre-installed with RStudio so there is need for further action.
  • If you are planing to use LaTeX to generate reports in PDF via R Markdown, it is better to install MacTeX distribution.

Shiny

  • Shiny is an R package that makes it easy to build interactive web apps straight from R. We are not going to cover Shiny; however, it is better to know it at least to understand the capabilities of R.
  • See here for a tutorial of Shiny. Some of the very good examples can be found in here and here.

Git

  • Git is a version control system for tracking changes in computer files. For more information about Git please see its wiki page.
  • The installation files for different operation systems can be found here. PC users should see this link for installation files and much more.
  • Git is mainly used in command line by PC users; however, for some users it might be cumbersome. Therefore, I suggest you to use a Graphical User Interface (GUI) for Git. All the GUIs can be found here. So far, I have tried SourceTree and GitHub Desktop. I prefer SourceTree since it is has better visualization, simple for beginners and can handle complicated git command very easily for experts. GitHub Desktop might be your choice if you need the simplest GUI.
  • See here for more information about Git. See here and even here for a tutorial of git.
  • To save your git repository remotely see Bitbucket or GitHub.
  • Finally for unlimited private remote repositories see here.

4 For All Users

R vs. RStudio

  • Again, note that we will use R as our main programming software but to make coding easier and more fun we will use RStudio as GUI which will use R at the background. Please take a look at the following screenshots to compare R and RStudio in terms of user functionality.

R General View

R General View


RStudio General View

RStudio General View


My RStudio View

My RStudio View


RStudio Preferences

  • If you want to see my RStudio preferences settings, please see the following screenshots. Note that I am using Mac and the settings might be slightly different for PC users.
  • Also, see here for customizing RStudio preferences.

RStudio Prefrences: General

RStudio Prefrences: General


RStudio Prefrences: Code - Editing

RStudio Prefrences: Code - Editing


RStudio Prefrences: Code - Display

RStudio Prefrences: Code - Display


RStudio Prefrences: Code - Saving

RStudio Prefrences: Code - Saving


RStudio Prefrences: Code - Completion

RStudio Prefrences: Code - Completion


RStudio Prefrences: Code - Diagnostic

RStudio Prefrences: Code - Diagnostic


RStudio Prefrences: Appearance

RStudio Prefrences: Appearance


RStudio Prefrences: Pane Layout

RStudio Prefrences: Pane Layout


RStudio Prefrences: Code - Packages

RStudio Prefrences: Code - Packages


RStudio Prefrences: R Markdown

RStudio Prefrences: R Markdown


RStudio Prefrences: Sweave

RStudio Prefrences: Sweave


RStudio Prefrences: Spelling

RStudio Prefrences: Spelling


RStudio Prefrences: Git/SVN

RStudio Prefrences: Git/SVN


RStudio Prefrences: Publishing

RStudio Prefrences: Publishing


RStudio Prefrences: Terminal

RStudio Prefrences: Terminal